<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //es6允许给形参赋初始值，一般靠后
    function add(a,b,c=10){
      return a+b+c
    }
    let result = add(1,2)
    console.log(result)

    //与结构赋值结合
    function connect({host,username,password,port='123'}){
      console.log(host)
      console.log(port)
    }
    connect({host:'atguigu.com', username:'尚硅谷', password:'root'})
  </script>
</body>
</html>